import 'package:flutter/material.dart';

/// 吐司弹出工具类
class ToastUtil {
  static toast(BuildContext context, String msg,
      {duration = const Duration(milliseconds: 600),
      Color? color,
      SnackBarAction? action}) {
    ScaffoldMessenger.of(context).showSnackBar(SnackBar(
      content: Text(msg),
      duration: duration,
      action: action,
      backgroundColor: color ?? Theme.of(context).primaryColor,
    ));
  }
}
